package com.ecoolex.ying.space.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   地产项目活动代金券<br>
 *<br>
 * 数据表： estate_project_activity_coupon
 *
 */
@Description({"地产项目活动代金券"})
public class EstateProjectActivityCoupon implements Serializable {
    /**
     *
     *   代金券Id    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CouponId
     */
    @Description({"代金券Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer couponId;

    /**
     *
     *   名称    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Name
     */
    @Description({"名称", "不能为空", "数据长度: 255"})
    @NonNull
    private String name;

    /**
     *
     *   副名称    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.SubName
     */
    @Description({"副名称", "数据长度: 400"})
    private String subName;

    /**
     *
     *   使用规则    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UseRules
     */
    @Description({"使用规则", "不能为空", "数据长度: 500"})
    @NonNull
    private String useRules;

    /**
     *
     *   售价    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.SalePrice
     */
    @Description({"售价", "不能为空", "数据长度: 18"})
    @NonNull
    private BigDecimal salePrice;

    /**
     *
     *   面值    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.FacePrice
     */
    @Description({"面值", "不能为空", "数据长度: 18"})
    @NonNull
    private BigDecimal facePrice;

    /**
     *
     *   使用门槛价格    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UsePrice
     */
    @Description({"使用门槛价格", "不能为空", "数据长度: 18"})
    @NonNull
    private BigDecimal usePrice;

    /**
     *
     *   上线    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Online
     */
    @Description({"上线", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean online;

    /**
     *
     *   生效日期    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.EffectTime
     */
    @Description({"生效日期", "不能为空", "数据长度: 26"})
    @NonNull
    private Date effectTime;

    /**
     *
     *   失效日期    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.ExpireTime
     */
    @Description({"失效日期", "不能为空", "数据长度: 26"})
    @NonNull
    private Date expireTime;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   代金券Id    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CouponId
     */
    public Integer getCouponId() {
        return couponId;
    }

    /**
     * 设置参数<br><br>
     *
     *   代金券Id<br>
     *<br>
     * 字段名： estate_project_activity_coupon.CouponId
     */
    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }

    /**
     * 获取参数<br><br>
     *
     *   名称    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置参数<br><br>
     *
     *   名称<br>
     *<br>
     * 字段名： estate_project_activity_coupon.Name
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   副名称    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.SubName
     */
    public String getSubName() {
        return subName;
    }

    /**
     * 设置参数<br><br>
     *
     *   副名称<br>
     *<br>
     * 字段名： estate_project_activity_coupon.SubName
     */
    public void setSubName(String subName) {
        this.subName = subName == null ? null : subName.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   使用规则    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UseRules
     */
    public String getUseRules() {
        return useRules;
    }

    /**
     * 设置参数<br><br>
     *
     *   使用规则<br>
     *<br>
     * 字段名： estate_project_activity_coupon.UseRules
     */
    public void setUseRules(String useRules) {
        this.useRules = useRules == null ? null : useRules.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   售价    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.SalePrice
     */
    public BigDecimal getSalePrice() {
        return salePrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   售价<br>
     *<br>
     * 字段名： estate_project_activity_coupon.SalePrice
     */
    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   面值    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.FacePrice
     */
    public BigDecimal getFacePrice() {
        return facePrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   面值<br>
     *<br>
     * 字段名： estate_project_activity_coupon.FacePrice
     */
    public void setFacePrice(BigDecimal facePrice) {
        this.facePrice = facePrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   使用门槛价格    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UsePrice
     */
    public BigDecimal getUsePrice() {
        return usePrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   使用门槛价格<br>
     *<br>
     * 字段名： estate_project_activity_coupon.UsePrice
     */
    public void setUsePrice(BigDecimal usePrice) {
        this.usePrice = usePrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   上线    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Online
     */
    public Boolean getOnline() {
        return online;
    }

    /**
     * 设置参数<br><br>
     *
     *   上线<br>
     *<br>
     * 字段名： estate_project_activity_coupon.Online
     */
    public void setOnline(Boolean online) {
        this.online = online;
    }

    /**
     * 获取参数<br><br>
     *
     *   生效日期    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.EffectTime
     */
    public Date getEffectTime() {
        return effectTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   生效日期<br>
     *<br>
     * 字段名： estate_project_activity_coupon.EffectTime
     */
    public void setEffectTime(Date effectTime) {
        this.effectTime = effectTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   失效日期    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.ExpireTime
     */
    public Date getExpireTime() {
        return expireTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   失效日期<br>
     *<br>
     * 字段名： estate_project_activity_coupon.ExpireTime
     */
    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： estate_project_activity_coupon.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： estate_project_activity_coupon.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： estate_project_activity_coupon.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        couponId("CouponId", "couponId", "INTEGER", false),
        name("Name", "name", "VARCHAR", true),
        subName("SubName", "subName", "VARCHAR", false),
        useRules("UseRules", "useRules", "VARCHAR", false),
        salePrice("SalePrice", "salePrice", "DECIMAL", false),
        facePrice("FacePrice", "facePrice", "DECIMAL", false),
        usePrice("UsePrice", "usePrice", "DECIMAL", false),
        online("Online", "online", "BIT", true),
        effectTime("EffectTime", "effectTime", "TIMESTAMP", false),
        expireTime("ExpireTime", "expireTime", "TIMESTAMP", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}